<template>
	<view class="content">
		<view class="title">请输入员工编号</view>
		<u-input class='intbor' v-model="value" :type="number" :border="border"  placeholder='请输入员工佩戴的编号' />
		<view class="butn" @click="subimit">查询</view>
		<u-modal v-model="show" :content="content" confirm-text='我知道了' title='安全提示' :show-cancel-button='false'></u-modal>
		<u-modal v-model="show2" confirm-text='确定' :show-title='false' :show-cancel-button='false'>
			<view class="userinfo">
				<view class="title">佛燃能源</view>
				<view class="name">
					{{name}}
				</view>
				<view class="userimg">
					<image :src="avatar" mode="aspectFill"></image>
				</view>
			
			</view>
			
		</u-modal>
	
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value: '',
				name:'',
				avatar:'',
				type: 'text',
				border: false,
				show:true,
				show2:false,
				content:'我公司人员上门服务时均穿着有“佛然能源"标识的应季服装并佩戴工牌，工牌上显示员工姓名、员工编号、员工照片,请广大用户留心辨识。如对上门人员身份有疑问，请拨打我公司24小时热线电话0318-3881118确认人员身份，以便相关工作进行。'
			}
		},
		methods: {
			subimit(){
				if(!this.value) this.$showToast('请输入员工编号')
				var _this = this
				uni.request({
					url:_this.$url + 'user.user/getStaffDetails',
					method:'POST',
					header:_this._header,
					data:{
						id:_this.value
					},
					success: (res) => {
						_this.$showToast(res.data.msg)
						if(res.data.code==1){
							this.name = res.data.data.realname
							this.avatar = res.data.data.avatar
							this.show2=true
						}
					}
				})
			},
		}
	}
</script>

<style lang="less" scoped>
   .content{
	   padding:10rpx 40rpx;
	   .title{
		   padding: 20rpx 0;
		   text-align: center;
		   color: #666;
		 
	   }
	   .intbor{
		   width: 600rpx;
		   border-bottom: 1px solid #d8d8d8;
		   margin: 0 auto;
	   }
	   .userinfo{
		   padding: 0 20rpx;
		   height: 600rpx;
		   .title{
		   		   line-height: 60rpx;
		   		   text-align: center;
		   		   color: #0055de;
				   font-size: 32rpx;
				   border-bottom: 1px solid #0055de;
		   		 
		   }
		   .name{
			   text-align: center;
			   padding:20rpx 0;
			   font-size: 32rpx;
		   }
		   .userimg{
			   text-align: center;
			   image{
				   height: 400rpx;
				    width: 360rpx;
			   }
			 
		   }
	   }

   }
</style>
